package com.jingtai.platform.controller.pay;

import com.jingtai.core.entity.pay.PlatformPay;
import com.jingtai.platform.service.pay.PlatformPayService;
import com.jingtai.platform.util.ResultUtil;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.jingtai.validate.swagger.CApiParam;

/**
 * 平台打款表
 *
 * @author sunlaiqian
 * @date 2020-12-02 18:31:32
 */
@Validated
@RestController
@RequestMapping("/platform/platformpay")
@Api(tags = "平台打款表")
public class PlatformPayController{

    @Autowired
    private PlatformPayService platformPayService;


    @ApiOperation("平台打款表列表查询")
    @GetMapping("/list")
    public ResultUtil aopPlatformPayList(@CApiParam(name = "page",value = "页数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("page") Integer page,
                              @CApiParam(name = "limit",value = "每页个数",required = true,cNotEmpty = true,cIntMin = 1) @RequestParam("limit") Integer limit,
                              @CApiParam(name = "conditions",value = "查询条件",required = false) @RequestParam("conditions") String conditions){
        return platformPayService.PlatformPaylist(page, limit, conditions);
    }


    @ApiOperation("根据ID查询platformPay实体")
    @GetMapping("/getPlatformPayById")
    public ResultUtil GetPlatformPayById(@CApiParam(name = "id",value = "platformPay实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return platformPayService.getPlatformPayById(id);
    }


    @ApiOperation("新增platformPay实体")
    @PostMapping("/add")
    @ApiOperationSupport(ignoreParameters = {"platformPay.id","platformPay.createTime","platformPay.updateTime","platformPay.deleteFlag"})
    public ResultUtil aopAddPlatformPay(@RequestBody @Validated PlatformPay platformPay){
        return platformPayService.addPlatformPay(platformPay);
    }

    @ApiOperation("编辑platformPay实体")
    @PostMapping("/edit")
    @ApiOperationSupport(ignoreParameters = {"platformPay.createTime","platformPay.updateTime","platformPay.deleteFlag"})
    public ResultUtil aopEditPlatformPay(@RequestBody @Validated PlatformPay platformPay){
        return platformPayService.editPlatformPay(platformPay);
    }

    @ApiOperation("根据ID删除platformPay实体")
    @GetMapping("/delPlatformPayById")
    public ResultUtil aopDelPlatformPayById(@CApiParam(name = "id",value = "platformPay实体ID",required = true,cNotEmpty = true) @RequestParam("id") Long id){
        return platformPayService.delPlatformPayById(id);
    }

}






